package Model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;


public class NguoiDung implements Serializable{
	private String ten;
	private String matkhau;
	private Integer quyen = 2;
	private Integer idnguoidung;
	private Set<HoaDon> dshd = new HashSet<HoaDon>();
	private String diachi;
	private Integer sodienthoai = 0;
	private String email;
	
	
	public String getDiachi() {
		return diachi;
	}
	public void setDiachi(String diachi) {
		this.diachi = diachi;
	}
	public Integer getSodienthoai() {
		return sodienthoai;
	}
	public void setSodienthoai(Integer sodienthoai) {
		this.sodienthoai = sodienthoai;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getTen() {
		return ten;
	}
	public void setTen(String ten) {
		this.ten = ten;
	}
	public String getMatkhau() {
		return matkhau;
	}
	public void setMatkhau(String matkhau) {
		this.matkhau = matkhau;
	}
	public Integer getQuyen() {
		return quyen;
	}
	public void setQuyen(Integer quyen) {
		this.quyen = quyen;
	}
	
	public Set<HoaDon> getDshd() {
		return dshd;
	}
	public void setDshd(Set<HoaDon> dshd) {
		this.dshd = dshd;
	}
	
	public Integer getIdnguoidung() {
		return idnguoidung;
	}
	public void setIdnguoidung(Integer idnguoidung) {
		this.idnguoidung = idnguoidung;
	}
	public String kiemtradangnhap(){
		if(this.ten.equalsIgnoreCase("admin") && this.matkhau.equals("superuser")){
		return "admin";
		}
		return null;
		
	}

}
